package com.ysm.smfu.fragment;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.EditText;

import com.ysm.smfu.R;
import com.ysm.smfu.activity.My_XiuGai_Activity;
import com.ysm.smfu.utils.ToastUtils;
import com.ysm.smfu.utils.UIUtils;
import com.zhy.autolayout.AutoRelativeLayout;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * Created by Administrator on 2016/9/26.
 */
public class BankFragment extends MyBaseFragment {
    @BindView(R.id.fragment_bank_name)
    EditText fragmentBankName;
    @BindView(R.id.fragment_bank_number)
    EditText fragmentBankNumber;
    @BindView(R.id.fragment_bank_addBank_next)
    AutoRelativeLayout fragmentBankAddBankNext;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View view = UIUtils.inflate(R.layout.fragment_add_bank);
        ButterKnife.bind(this, view);
        UIUtils.openKeyboard();
        return view;
    }


    @OnClick({R.id.fragment_bank_name, R.id.fragment_bank_number, R.id.fragment_bank_addBank_next})
    public void onClick(View view) {
        switch (view.getId()) {

            case R.id.fragment_bank_addBank_next:
                String name = fragmentBankName.getText().toString().trim();
                String num = fragmentBankNumber.getText().toString().trim();

                if (TextUtils.isEmpty(name) || TextUtils.isEmpty(num)) {
                    ToastUtils.showToast("账号或密码为空");
                    break;
                }
//                跳往下一步
                UIUtils.startActivity(My_XiuGai_Activity.class, "position", 4);
                break;
        }
    }
}
